<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>审核司机</title>
        <link rel="stylesheet" href="__PUBLIC__/Leader/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="__PUBLIC__/Leader/css/index.css" />
        <style type="text/css">
            body{
                overflow-y: hidden;
                overflow-x: hidden;
            }
            .checksiji{
                width:80%;
                height:auto;
                padding:0.5%;
                margin: 0 auto;
            }
            .noactive{
                display: none;
            }
        </style>
    </head>
    <body>
            <div class="checksiji">
                <!--司机的基本信息-->

                
                    <form role="form" id="formcheck">
                        <div class="form-group">
                            <label>审核：</label>
                            <input type="radio" value="1" name="status" class="input-xlarge" <if condition="$siji.status eq '1'">checked</if>>通过
                            <input type="radio" value="2" name="status" class="input-xlarge" <if condition="$siji.status eq '2'">checked</if>>不通过
                        </div>
                        <div class="form-group reaseon noactive">
                            <textarea name="description" rows="3" placeholder="不通过的原因"></textarea>
                        </div>
                        <div class="form-group">
                            <button  type="button" class="btn btn-primary formchecksub">修改</button>
                        </div>
                        <input type="hidden" value="{$siji.openid}" name="openid"/>
                    </form>

                   
 

            </div>
    </body>

    <script src="__PUBLIC__/Leader/js/jquery.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/Leader/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="__PUBLIC__/layer/layer.js" type="text/javascript" charset="utf-8"></script>

    <script type="text/javascript">
        /**
         * 当审核不通过的显示不通过的原因框
         */
        $("input[type=radio]").on("click",function () {
            var radioval = $(this).val();
            if(radioval == 2){
                $('.reaseon').css('display','block');
            }else{
                $('.reaseon').css('display','none');
            }
        });

        /**
         * ajax修改通过与不通过的状态
         */
        $(".formchecksub").on("click",function () {
            $.ajax({
                type: "POST",
                url: "{:U('sijicheck')}",
                data: $("#formcheck").serialize(),
                success: function(msg){
                    var data = JSON.parse(msg);
                    if(data.code == 1){
                        parent.location.reload(); // 父页面刷新
                        layer.closeAll();
                    }else{
                        layer.msg(data.msg)
                    }
                }
            });
        })

    </script>

</html>